# Template file for 'dwm'
pkgname=dwm
version=6.4
revision=1
makedepends="libXinerama-devel libXft-devel freetype-devel libxcb-devel"
short_desc="Dynamic window manager for X"
maintainer="privatewright <privateercp@protonmail.com>"
license="MIT"
homepage="https://dwm.suckless.org"
distfiles="https://dl.suckless.org/dwm/dwm-${version}.tar.gz"
checksum=fa9c0d69a584485076cfc18809fd705e5c2080dafb13d5e729a3646ca7703a6e

do_build() {
	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
	vsed -e "/CFLAGS/s|\${CPPFLAGS}|& $CFLAGS|g" -i config.mk
	make CC=$CC INCS="-I. -I${XBPS_CROSS_BASE}/usr/include/freetype2" LIBS="-lX11 -lXinerama -lXft -lfontconfig -lX11-xcb -lxcb -lxcb-res ${KVMLIB}"
}

do_install() {
	make PREFIX=/usr DESTDIR=$DESTDIR install
	vinstall README 644 usr/share/doc/$pkgname
	vinstall ${FILESDIR}/dwm.desktop 644 usr/share/xsessions
	vlicense LICENSE
}
